package com.imy.accessibility.dialog;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.imy.accessibility.R;
import com.imy.accessibility.bean.NodeItem;
import com.imy.common.base.adapter.BaseSimpleListAdapter;
import com.imy.common.base.adapter.BaseViewHolder;

import java.util.List;

public class NodeInfoAdapter extends BaseSimpleListAdapter<NodeItem, NodeInfoAdapter.Holder> {


    public NodeInfoAdapter(Context context, List<NodeItem> infos) {
        super(context, infos);

    }







    @Override
    protected void bindView(int position, Holder holder, View convertView, NodeItem bean) {
       holder.title.setText(bean.title);
       holder.des.setText(bean.des);
    }

    private void setValue(Holder holder, String title, String des) {
        holder.title.setText(title);
        holder.des.setText(des);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.inclue_node_item;
    }

    @Override
    public Holder getHolder(View view) {
        return new Holder(view);
    }

    public static class Holder extends BaseViewHolder {

        private TextView title;
        private TextView des;

        public Holder(View itemView) {
            super(itemView);
            title = itemView.findViewById(R.id.node_item_title_tv);
            des = itemView.findViewById(R.id.node_item_des_tv);
        }
    }
}
